﻿(function () {
    function indexOf(element) {
        for (var i = 0; i < this.length; i++) {
            if (this[i] == element) {
                return i;
            }
        }
        return -1;
    }

    var jasmineEnv = jasmine.getEnv();
    var addReporter = jasmineEnv.addReporter;

    jasmineEnv.addReporter = function (reporter) {
        if ((reporter instanceof window.ReSharperReporter) && reporter.specs) {
            reporter.specs.indexOf = indexOf;
        }
        addReporter.call(this, reporter);
    };
})();